<style>
.lyear-wrapper {
    position: relative;
}
.lyear-login {
    display: flex !important;
    min-height: 100vh;
    align-items: center !important;
    justify-content: center !important;
}
.lyear-login:after{
    content:'';
    min-height:inherit;
    font-size:0;
}
.login-center {
    background: #fff;
    min-width: 29.25rem;
    padding: 2.14286em 3.57143em;
    border-radius: 5px;
    margin: 2.85714em;
}
.login-header {
    margin-bottom: 1.5rem !important;
}
.login-center .has-feedback.feedback-left .form-control {
    padding-left: 38px;
    padding-right: 12px;
}
.login-center .has-feedback.feedback-left .form-control-feedback {
    left: 0;
    right: auto;
    width: 38px;
    height: 38px;
    line-height: 38px;
    z-index: 4;
    color: #dcdcdc;
}
.login-center .has-feedback.feedback-left.row .form-control-feedback {
    left: 15px;
}
</style>
<div class="row lyear-wrapper">
  <div class="lyear-login">
    <div class="login-center">
      <div class="login-header text-center" style="font-size: 20px;font-weight: bold;">
AI系统
      </div>
      <form action="" method="post" onsubmit="return onFormSubmit()">
        <div class="form-group has-feedback feedback-left">
          <input type="text" placeholder="请输入账号" class="form-control" id="username" autocomplete="off" required="required">
        </div>
        <div class="form-group has-feedback feedback-left">
          <input type="password" placeholder="请输入密码" class="form-control" id="password"  autocomplete="off" required>
        </div>
        <div class="form-group">
          <button class="btn btn-block btn-primary" type="submit">立即登录</button>
        </div>
      </form>
    </div>
  </div>
</div>
<script>
function onFormSubmit(){
	var data = {username:$.trim($('#username').val()),passwd:$.trim($('#password').val())};
	if(data['username'] == ''){
		lightyear.notify('账号不能为空', 'danger', 100);
		return false;
	}
	if(data['password'] == ''){
		lightyear.notify('密码不能为空', 'danger', 100);
		return false;
	}
	lightyear.loading('show');
	$.ajax({
	    type: "POST",
	    url: "?a=login",
	    dataType:'json',
	    data:data,
	    success: function(res) {
	    	lightyear.loading('hide');
	        if(res.code == 1){
	        	lightyear.notify('登录成功', 'success', 1500);
	        	setTimeout(function(){
	        		location.href = "?";
	        	},1500);
	        }else{
	        	lightyear.notify(res.msg, 'danger', 100);
	        }
	    }
	});
    return false;
}
</script>